<!DOCTYPE html>
<html>
<head>
    <title>DOM Level 2 CreateDocument Example</title>
</head>
<body>
    <script type="text/javascript">
        var doctype = document.implementation.createDocumentType("html",
                          " -//W3C//DTD XHTML 1.0 Strict//EN",
                          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd");
        
        var doc = document.implementation.createDocument("http://www.w3.org/1999/xhtml",
                      "html", doctype);
        alert(doc.documentElement.tagName);
    </script>
</body>
</html>